﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Data;
using System.Collections;
using KPIS.GERP.GHRMS.BLL;
using KPIS.GERP.GHRMS.IBLL;
using KPIS.GERP.GHRMS.MODEL;
namespace KPIS.GERP.GHRMS.APP.App_UI.Controls
{
    public partial class SpouseCombo : System.Web.UI.UserControl
    {
        private IHisSpouseBLL BLL = new HisSpouseBLL();
        private HisSpouseInfo Info = new HisSpouseInfo();
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        public void ListSpouseComboBox(string Employee)
        {
            Nullable<int> nEmpSeq = Employee.Length > 0 ? Int32.Parse(Employee) : (int?)null;
            DataSet ds = null;
            DataTable dt = null;

            ds = BLL.LoadSpouse((int?)null, nEmpSeq);
            dt = ds.Tables[0];

            //IList<HisSpouseInfo> InfoList = BLL.ListHisSpouses(Employee);

            //DataTable t = new DataTable();
            //t.Columns.Add("Sequence", typeof(int));
            //t.Columns.Add("Name", typeof(string));

            //foreach (HisSpouseInfo Info in InfoList)
            //{
            //    DataRow row = t.NewRow();
              
            //    row["Sequence"] = Info.Sequence;
            //    row["Name"] = Info.Person.FullName;

            //    t.Rows.Add(row);
            //}

            cbSpouses.DataSource = dt;
            cbSpouses.DataBind();
        }
    }
}